<template>
  <div style="overflow-y: hidden;overflow-x: hidden;" class="app-wrapperhideSidebar">
    <iframe
      frameborder="no" border="0"
      :src="iframeUrl"
      id="bdIframe"
      sandbox="allow-forms allow-scripts allow-same-origin allow-popups">
    </iframe>
  </div>
</template>

<script>
export default {
  name: "Index",
  data() {
    return {
      iframeUrl: "http://qingyinyue.club/"
    };
  },
  mounted() {
    /**
     * iframe-宽高自适应显示
     */

    this.adjustIframe()
    window.onresize = () => {
      return (() => {
        this.adjustIframe()
      })();
    };
  },
  methods: {
    adjustIframe() {
      let screenWidth = document.body.clientWidth;
      let screenHeight = document.body.clientHeight;

      const oIframe = document.getElementById('bdIframe');
      const deviceWidth = document.documentElement.clientWidth;
      const deviceHeight = document.documentElement.clientHeight;
      oIframe.style.width = screenWidth + 'px'; //数字是页面布局宽度差值
      oIframe.style.height = screenHeight - 54 + 'px'; //数字是页面布局高度差
    },
  },
};
</script>

<style scoped>

/deep/ body {
  overflow-y: hidden !important;
}
</style>

